<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<title>定时任务</title>
	<%@ include file="/common/import.jsp" %>
	<script type="text/javascript" src="${ctx}/js/zbxtools.js"></script>
	<script type="text/javascript" src="${ctx}/js/easyui/extendvalidate.js"></script>
<script type="text/javascript">
	var inputForm = '#inputForm';
	function doSubmit(){
		var flag = $(inputForm).form('validate');
		if(flag){
			//ZBXTools.showProcess('正在提交数据...');
			$.ajax({
				   type:'put',
				   url:'${ctx}/send/sendmsg/msg/${item.msgId}',
				   data:$("#inputForm").serialize(),
				   dataType:'json',
				   success: function(myData){
					   if(myData.flag=='T'){
				    		$.messager.confirm('提交结果', '操作成功', function(){
								parent.colseAdd();// 关闭添加窗口
				    			parent.cateReload();// 刷新列表
							});
				    	}else{
				    		$.messager.alert('提交结果', myData.msg, 'info');
				    	}   
				  }
			});	
		}
	}
</script>
</head>
<body>	
<div id="tip"> </div>
		<form id="inputForm" name="inputForm" >
			<input type="hidden" name="formToken" id="formToken" value="${formToken}"/>
			<input type="hidden" name="msgId" id="msgId" value="${item.msgId}"/>
			<table class="datagrid-body" >
			<tr>
				<td class="datagrid-header">作务名称</td>
				<td>
					<input id="msgTitle" name="msgTitle" value="${item.msgTitle}"
					class="easyui-validatebox"  size="50" missingMessage="请输入作务名称"  />
				</td>
			</tr>
			<tr >
				<td class="datagrid-header">消息类型<font color=red>*</font></td>
				<td>
				    <select name="msgType" id="msgType" disabled="disabled">
					   <option value="">--请选择--</option>
					   <option value="email">邮箱</option>
					   <option value="mobile">手机</option>
					   <option value="all">邮箱和手机</option>
					</select>
				</td>
			</tr>
			<tr >
				<td class="datagrid-header">发送人<font color=red>*</font></td>
				<td>
					<input name="fromUserName" id="fromUserName" value="${item.fromUserName}"
					class="easyui-validatebox" data-options="required:true" size="50"
					missingMessage="请输入发送人" invalidMessage="" />				
				</td>
			</tr>
			<c:if test="${item.msgType=='email' || item.msgType=='all' }">
			<tr >
				<td class="datagrid-header">发送人邮箱<font color=red>*</font></td>
				<td>
					<input name="fromUserEmail" id="fromUserEmail" value="${item.fromUserEmail}" readonly="readonly"
					class="easyui-validatebox" data-options="required:true" size="50"
					missingMessage="请输入发送人" invalidMessage="" />				
				</td>
			</tr>
			</c:if>
			<c:if test="${item.msgType=='mobile' || item.msgType=='all' }">
			<tr >
				<td class="datagrid-header">发送人电话<font color=red>*</font></td>
				<td>
					<input name="fromUserMobile" id="fromUserMobile" value="${item.fromUserMobile}"  readonly="readonly"
					class="easyui-validatebox" data-options="required:true" size="50"
					missingMessage="请输入发送人电话" invalidMessage="" />				
				</td>
			</tr>
			</c:if>
			<tr >
				<td class="datagrid-header">接收人<font color=red>*</font></td>
				<td>
					<input name="toUserName" id="toUserName" value="${item.toUserName}"
					class="easyui-validatebox" data-options="required:true" size="50"
					missingMessage="请输入发送人" invalidMessage="" />				
				</td>
			</tr>
			<c:if test="${item.msgType=='email' || item.msgType=='all' }">
			<tr >
				<td class="datagrid-header">接收人邮箱<font color=red>*</font></td>
				<td>
					<input name="toUserEmail" id="toUserEmail" value="${item.toUserEmail}" readonly="readonly"
					class="easyui-validatebox" data-options="required:true" size="50"
					missingMessage="请输入发送人" invalidMessage="" />				
				</td>
			</tr>
			</c:if>
			<c:if test="${item.msgType=='mobile' || item.msgType=='all' }">
			<tr >
				<td class="datagrid-header">接收人电话<font color=red>*</font></td>
				<td>
					<input name="toUserMobile" id="toUserMobile" value="${item.toUserMobile}"  readonly="readonly"
					class="easyui-validatebox" data-options="required:true" size="50"
					missingMessage="请输入发送人电话" invalidMessage="" />				
				</td>
			</tr>
			</c:if>
			<tr>
				<td class="datagrid-header"></td>
				<td >	
					<a href="#" class="easyui-linkbutton" id="bt1" iconCls="icon-save" onclick="doSubmit();">提交</a>
					<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="parent.colseAdd();"; >取消</a>	
				</td>
			</tr>
			</table>
		</form>
</body>
<script>
	ZBXTools.initSelect("msgType","${item.msgType}");
</script>
</html>